
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1.5 命令执行统计 · 命令进阶</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../common-format/common-format.html" />
    
    
    <link rel="prev" href="selector/selector.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    引言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="concepts.html">
            
                <a href="concepts.html">
            
                    
                    1 基础概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="space.html">
            
                <a href="space.html">
            
                    
                    1.1 坐标、朝向、区块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="time.html">
            
                <a href="time.html">
            
                    
                    1.2 时间、顺序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="execution.html">
            
                <a href="execution.html">
            
                    
                    1.3 命令执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="selector/selector.html">
            
                <a href="selector/selector.html">
            
                    
                    1.4 目标选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.5" data-path="stats.html">
            
                <a href="stats.html">
            
                    
                    1.5 命令执行统计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../common-format/common-format.html">
            
                <a href="../common-format/common-format.html">
            
                    
                    2 常用命令格式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../common-format/json/json.html">
            
                <a href="../common-format/json/json.html">
            
                    
                    2.1 JSON文本
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../common-format/json/type.html">
            
                <a href="../common-format/json/type.html">
            
                    
                    2.1.1 JSON文本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../common-format/json/formatting.html">
            
                <a href="../common-format/json/formatting.html">
            
                    
                    2.1.2 JSON样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../common-format/json/event.html">
            
                <a href="../common-format/json/event.html">
            
                    
                    2.1.3 JSON事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../common-format/json/array.html">
            
                <a href="../common-format/json/array.html">
            
                    
                    2.1.4 JSON分项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../common-format/json/sign-book.html">
            
                <a href="../common-format/json/sign-book.html">
            
                    
                    2.1.5 告示牌及成书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../common-format/json/other.html">
            
                <a href="../common-format/json/other.html">
            
                    
                    2.1.6 杂项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../common-format/json/keys.html">
            
                <a href="../common-format/json/keys.html">
            
                    
                    2.1.A 附录: keybind列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../common-format/nbt/nbt.html">
            
                <a href="../common-format/nbt/nbt.html">
            
                    
                    2.2 NBT及结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../common-format/nbt/simple.html">
            
                <a href="../common-format/nbt/simple.html">
            
                    
                    2.2.1 基本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../common-format/nbt/example.html">
            
                <a href="../common-format/nbt/example.html">
            
                    
                    2.2.2 NBT实战
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../command/command.html">
            
                <a href="../command/command.html">
            
                    
                    3 如何执行命令
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../command/chat.html">
            
                <a href="../command/chat.html">
            
                    
                    3.1 聊天栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../command/cb.html">
            
                <a href="../command/cb.html">
            
                    
                    3.2 命令方块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../command/function.html">
            
                <a href="../command/function.html">
            
                    
                    3.3 命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../scoreboard/scoreboard.html">
            
                <a href="../scoreboard/scoreboard.html">
            
                    
                    4 记分板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../scoreboard/objective.html">
            
                <a href="../scoreboard/objective.html">
            
                    
                    4.1 记分板变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../scoreboard/team.html">
            
                <a href="../scoreboard/team.html">
            
                    
                    4.2 记分板队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../scoreboard/tag.html">
            
                <a href="../scoreboard/tag.html">
            
                    
                    4.3 记分板标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../scoreboard/command.html">
            
                <a href="../scoreboard/command.html">
            
                    
                    4.4 记分板命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../scoreboard/example.html">
            
                <a href="../scoreboard/example.html">
            
                    
                    4.5 记分板实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.5.1" data-path="../scoreboard/examples/example1.html">
            
                <a href="../scoreboard/examples/example1.html">
            
                    
                    4.5.1 循环电路|记分板的基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.2" data-path="../scoreboard/examples/example2.html">
            
                <a href="../scoreboard/examples/example2.html">
            
                    
                    4.5.2 自定义命令|stats与记分板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.3" data-path="../scoreboard/examples/example3.html">
            
                <a href="../scoreboard/examples/example3.html">
            
                    
                    4.5.3 击杀率|operation与准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.4" data-path="../scoreboard/examples/example4.html">
            
                <a href="../scoreboard/examples/example4.html">
            
                    
                    4.5.4 漂亮的排名|显示与队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.5" data-path="../scoreboard/examples/example5.html">
            
                <a href="../scoreboard/examples/example5.html">
            
                    
                    4.5.5 简单登入系统|function与综合运用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../logic/logic.html">
            
                <a href="../logic/logic.html">
            
                    
                    5 基础逻辑
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../logic/enum.html">
            
                <a href="../logic/enum.html">
            
                    
                    5.1 穷举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../logic/score.html">
            
                <a href="../logic/score.html">
            
                    
                    5.2 分数处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../logic/bool.html">
            
                <a href="../logic/bool.html">
            
                    
                    5.3 布尔逻辑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../logic/loop.html">
            
                <a href="../logic/loop.html">
            
                    
                    5.4 循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../logic/event.html">
            
                <a href="../logic/event.html">
            
                    
                    5.5 事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../logic/marker.html">
            
                <a href="../logic/marker.html">
            
                    
                    5.6 实体Marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../logic/execute.html">
            
                <a href="../logic/execute.html">
            
                    
                     5.7 execute进阶
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../practise/practise.html">
            
                <a href="../practise/practise.html">
            
                    
                    6 实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../practise/objects.html">
            
                <a href="../practise/objects.html">
            
                    
                    6.1 游戏内物件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../practise/test-debug.html">
            
                <a href="../practise/test-debug.html">
            
                    
                    6.2 命令系统测试及调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../practise/examples/examples.html">
            
                <a href="../practise/examples/examples.html">
            
                    
                    6.3 更多命令系统例子
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../practise/examples/furnace.html">
            
                <a href="../practise/examples/furnace.html">
            
                    
                    6.3.1 熔炉过热系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../practise/examples/badapple.html">
            
                <a href="../practise/examples/badapple.html">
            
                    
                    6.3.2 毒苹果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../practise/examples/rain.html">
            
                <a href="../practise/examples/rain.html">
            
                    
                    6.3.3 下雨检测
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="../practise/examples/chest_replace.html">
            
                <a href="../practise/examples/chest_replace.html">
            
                    
                    6.3.4 替换方块实体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="../practise/examples/skill.html">
            
                <a href="../practise/examples/skill.html">
            
                    
                    6.3.5 技能系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.6" data-path="../practise/examples/crown.html">
            
                <a href="../practise/examples/crown.html">
            
                    
                    6.3.6 皇冠系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.7" data-path="../practise/examples/blackhole.html">
            
                <a href="../practise/examples/blackhole.html">
            
                    
                    6.3.7 黑洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.8" data-path="../practise/examples/login.html">
            
                <a href="../practise/examples/login.html">
            
                    
                    6.3.8 登录系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../data-files/data-files.html">
            
                <a href="../data-files/data-files.html">
            
                    
                    7 游戏文件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../data-files/resourcepack/resourcepack.html">
            
                <a href="../data-files/resourcepack/resourcepack.html">
            
                    
                    7.1 资源包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1.1" data-path="../data-files/resourcepack/textures.html">
            
                <a href="../data-files/resourcepack/textures.html">
            
                    
                    7.1.1 材质
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.2" data-path="../data-files/resourcepack/models.html">
            
                <a href="../data-files/resourcepack/models.html">
            
                    
                    7.1.2 模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.3" data-path="../data-files/resourcepack/sound.html">
            
                <a href="../data-files/resourcepack/sound.html">
            
                    
                    7.1.3 声音
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../data-files/loot-table.html">
            
                <a href="../data-files/loot-table.html">
            
                    
                    7.2 Loot table
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../data-files/advancements/advancements.html">
            
                <a href="../data-files/advancements/advancements.html">
            
                    
                    7.3 Advancement
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="../data-files/advancements/examples.html">
            
                <a href="../data-files/advancements/examples.html">
            
                    
                    Advancement例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    8 杂项
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <a target="_blank" href="https://commandtutorials.neocities.org/">
            
                    
                    8.1 其他资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../misc/success.html">
            
                <a href="../misc/success.html">
            
                    
                    8.2 如何成为一个成功的CBer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../misc/question.html">
            
                <a href="../misc/question.html">
            
                    
                    8.3 问问题的技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../misc/quotes.html">
            
                <a href="../misc/quotes.html">
            
                    
                    8.4 其他CBer的建言
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >1.5 命令执行统计</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6267;&#x884C;&#x7EDF;&#x8BA1;">&#x6267;&#x884C;&#x7EDF;&#x8BA1;</h1>
<p>&#x547D;&#x4EE4;&#x6267;&#x884C;&#x7684;&#x65F6;&#x5019;&#x4F1A;&#x7EDF;&#x8BA1;&#x5F71;&#x54CD;&#x5230;&#x7684;&#x4E1C;&#x897F;&#x6570;&#x91CF;&#x3001;&#x6210;&#x529F;&#x6267;&#x884C;&#x6B21;&#x6570;&#x4E0E;&#x6267;&#x884C;&#x7ED3;&#x679C;&#x3002;<br>&#x6240;&#x6709;&#x7EDF;&#x8BA1;&#x90FD;&#x662F;&#x6574;&#x6570;&#xFF0C;&#x50A8;&#x5B58;&#x5728;NBT&#x91CC;&#xFF0C;&#x9700;&#x8981;&#x65F6;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x7528;nbt&#x67E5;&#x8BE2;&#x6216;&#x4EE5;<code>stats</code>&#x547D;&#x4EE4;&#x7ED1;&#x5B9A;&#x5230; &#x6307;&#x5B9A;&#x73A9;&#x5BB6;&#x540D;/&#x5B9E;&#x4F53; &#x7684;&#x8BB0;&#x5206;&#x677F;&#x5206;&#x6570;&#x3002;</p>
<p>&#x6CE8;&#x610F;: &#x4E4B;&#x540E;&#x7684;&#x6267;&#x884C;&#x7ED3;&#x679C;&#x4F1A;&#x8986;&#x76D6;&#x4E4B;&#x524D;&#x7684;&#x6570;&#x503C;&#x3002;&#x8FD9;&#x5728;&#x8FDB;&#x884C;<code>execute</code>&#x547D;&#x4EE4;&#x5D4C;&#x5957;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5F80;&#x5F80;&#x4F1A;&#x8BA9;&#x4EBA;&#x641E;&#x9519;&#x6BCF;&#x4E00;&#x5C42;&#x5D4C;&#x5957;&#x6D89;&#x53CA;&#x5230;&#x7684;&#x5B9E;&#x4F53;&#x7684;&#x6700;&#x7EC8;&#x7EDF;&#x8BA1;&#x503C;&#x7A76;&#x7ADF;&#x6765;&#x81EA;&#x54EA;&#x4E00;&#x5C42;&#x547D;&#x4EE4;&#x3002;</p>
<p>&#x6267;&#x884C;&#x7EDF;&#x8BA1;&#x5305;&#x62EC;:</p>
<ul>
<li>&#x6210;&#x529F;&#x6267;&#x884C;&#x6B21;&#x6570;(SuccessCount)&#xFF0C;&#x5982;<code>testfor @a {SelectedItem:{id:&quot;minecraft:stone&quot;}}</code>&#x7684;&#x7B26;&#x5408;&#x73A9;&#x5BB6;&#x6570;&#x91CF;&#x3002;</li>
<li>&#x5F71;&#x54CD;&#x5B9E;&#x4F53;&#x6570;(AffectedEntities)&#xFF0C;&#x5982;<code>testfor @a</code>&#x9009;&#x62E9;&#x5230;&#x7684;&#x73A9;&#x5BB6;&#x6570;&#x91CF;&#x3002;</li>
<li>&#x5F71;&#x54CD;&#x65B9;&#x5757;&#x6570;(AffectedBlocks)&#xFF0C;&#x6216;&#x662F;&#x63A2;&#x6D4B;&#x5230;&#x7684;&#x65B9;&#x5757;&#x6570;&#x3002;&#x5982;<code>testforblocks</code>&#x6216;<code>clone</code>&#x63A2;&#x6D4B;/&#x590D;&#x5236;&#x5230;&#x7684;&#x65B9;&#x5757;&#x6570;&#x3002;</li>
<li>&#x5F71;&#x54CD;&#x7269;&#x54C1;&#x6570;(AffectedItems)&#xFF0C;&#x6216;&#x662F;&#x63A2;&#x6D4B;&#x5230;&#x7684;&#x7269;&#x54C1;&#x6570;&#x3002;&#x5982;<code>clear</code>&#x6210;&#x529F;&#x6E05;&#x9664;/&#x68C0;&#x6D4B;&#x5230;&#xFF08;&#x5982;&#x679C;&#x6700;&#x5927;&#x6E05;&#x9664;&#x6570;&#x91CF;&#x8BBE;&#x7F6E;&#x4E3A;0&#xFF09;&#x7684;&#x7269;&#x54C1;&#x6570;&#x91CF;&#x3002;</li>
<li>&#x67E5;&#x8BE2;&#x7ED3;&#x679C;(QueryResult)&#xFF0C;&#x90E8;&#x5206;&#x67E5;&#x8BE2;&#x7C7B;&#x7684;&#x547D;&#x4EE4;&#x4F1A;&#x628A;&#x7ED3;&#x679C;&#x5199;&#x8FDB;&#x8FD9;&#x7EDF;&#x8BA1;&#x91CC;&#xFF0C;&#x5982;<code>time query gametime</code>&#x3001;<code>worldborder get</code>&#x7B49;&#x3002;</li>
</ul>
<h2 id="&#x547D;&#x4EE4;&#x6267;&#x884C;&#x8FC7;&#x7A0B;">&#x547D;&#x4EE4;&#x6267;&#x884C;&#x8FC7;&#x7A0B;</h2>
<p>&#x5F53;&#x6E38;&#x620F;&#x9700;&#x8981;&#x6267;&#x884C;&#x4E00;&#x6761;&#x547D;&#x4EE4;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B83;&#x4F1A;&#x4F5C;&#x51FA;&#x4EE5;&#x4E0B;&#x5904;&#x7406;&#xFF1A;</p>
<ol>
<li>&#x628A;&#x547D;&#x4EE4;&#x4EE5;&#x7A7A;&#x683C;&#x4E3A;&#x5206;&#x9694;&#x7B26;&#x5206;&#x6210;&#x4E0D;&#x540C;&#x7684;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x547D;&#x4EE4;&#x5217;&#x8868;&#x91CC;&#x641C;&#x5BFB;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x6240;&#x4EE3;&#x8868;&#x7684;&#x547D;&#x4EE4;&#x3002;&#x5373;&#xFF0C;&#x5982;&#x679C;&#x547D;&#x4EE4;&#x7B2C;&#x4E00;&#x4E2A;&#x7A7A;&#x683C;&#x524D;&#x7684;&#x90E8;&#x5206;&#x4E3A;<code>scoreboard</code>&#xFF0C;&#x5219;&#x5C06;&#x5224;&#x65AD;&#x8FD9;&#x662F;&#x4E00;&#x6761;&#x8BB0;&#x5206;&#x677F;&#x547D;&#x4EE4;&#x3002;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x5BF9;&#x5E94;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x5219;&#x62A5;&#x9519;&#x201C;&#x672A;&#x77E5;&#x547D;&#x4EE4;&#x201D;&#x3002;</li>
<li>&#x5C1D;&#x8BD5;&#x5224;&#x65AD;&#x8FD9;&#x6761;&#x547D;&#x4EE4;&#x662F;&#x5426;&#x5BF9;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x6267;&#x884C;&#xFF0C;&#x5B9E;&#x73B0;&#x65B9;&#x5F0F;&#x662F;&#x627E;&#x51FA;&#x547D;&#x4EE4;&#x4E2D;<strong>&#x7B2C;&#x4E00;&#x4E2A;</strong>&#x53EF;&#x9009;&#x62E9;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x7684;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;&#x3002;&#x5177;&#x4F53;&#x8FC7;&#x7A0B;&#x5982;&#x4E0B;&#xFF1A;<ol>
<li>&#x68C0;&#x6D4B;&#x76EE;&#x6807;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#x5728;&#x547D;&#x4EE4;&#x7684;&#x683C;&#x5F0F;&#x4E2D;&#x662F;&#x5426;&#x662F;&#x4E00;&#x4E2A;&#x5B9E;&#x4F53;&#x53C2;&#x6570;&#x3002;&#xFF08;&#x6BD4;&#x5982;<code>give @a stone</code>&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;<code>@a</code>&#xFF09;&#x3002;</li>
<li>&#x5982;&#x679C;&#x662F;&#xFF0C;&#x5219;&#x68C0;&#x67E5;&#x6B64;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#x662F;&#x5426;&#x662F;&#x4E00;&#x4E2A;&#x9009;&#x62E9;&#x5668;&#x3002;</li>
<li>&#x5982;&#x679C;&#x662F;&#xFF0C;&#x5219;&#x68C0;&#x67E5;&#x6B64;&#x9009;&#x62E9;&#x5668;&#x6700;&#x591A;&#x80FD;&#x9009;&#x62E9;&#x5230;&#x5B9E;&#x4F53;&#x7684;&#x6570;&#x76EE;&#x662F;&#x5426;&#x4E3A;&#x975E;1&#xFF08;<code>@a</code>&#x548C;<code>@e</code>&#x4EE5;&#x5916;&#x7684;&#x9ED8;&#x8BA4;&#x9009;&#x62E9;1&#x4E2A;&#x3002;&#x5982;&#x679C;&#x5B58;&#x5728;<code>c</code>&#x53C2;&#x6570;&#x5219;&#x770B;<code>c</code>&#x53C2;&#x6570;&#x7684;&#x6570;&#x91CF;&#x3002;&#xFF09;<br>&#x4F8B;&#x5B50;: <code>@e &#x2260; 1</code> <code>@e[c=1] = 1</code> <code>@r = 1</code> <code>@r[c=5] &#x2260; 1</code> <code>@a[c=-5] &#x2260; 1</code></li>
<li>&#x5982;&#x679C;&#x662F;&#xFF0C;&#x5219;&#x4EE3;&#x8868;&#x627E;&#x5230;&#x4E86;&#x7B2C;&#x4E00;&#x4E2A;&#x9009;&#x62E9;&#x591A;&#x76EE;&#x6807;&#x7684;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x5373;&#x8BE5;&#x547D;&#x4EE4;&#x5BF9;&#x591A;&#x5B9E;&#x4F53;&#x6267;&#x884C;&#xFF0C;&#x641C;&#x5BFB;&#x7EC8;&#x6B62;&#xFF1B;&#x5426;&#x5219;&#x5219;&#x4EE5;&#x4E0B;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#x4E3A;&#x76EE;&#x6807;&#x7EE7;&#x7EED;&#x91CD;&#x590D;1-3&#x6B65;&#xFF0C;&#x76F4;&#x5230;&#x627E;&#x5230;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x7684;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#x6216;&#x904D;&#x5386;&#x5B8C;&#x5168;&#x90E8;&#x547D;&#x4EE4;&#x53C2;&#x6570;&#x3002;</li>
</ol>
</li>
<li>&#x5982;&#x679C;&#x7ECF;&#x7531;&#x7B2C;&#x4E8C;&#x6B65;&#x7684;&#x5224;&#x65AD;&#x5F97;&#x5230;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x591A;&#x76EE;&#x6807;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x5219;&#x6839;&#x636E;&#x627E;&#x5230;&#x7684;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;&#x641C;&#x5BFB;&#x6240;&#x6709;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x7684;&#x5B9E;&#x4F53;&#x5E76;&#x6392;&#x5E8F;&#xFF0C;&#x7136;&#x540E;&#x9010;&#x4E2A;&#x66FF;&#x6362;&#x5177;&#x4F53;&#x5B9E;&#x4F53;&#x81F3;&#x9009;&#x62E9;&#x5668;&#x4F4D;&#x7F6E;&#x3002;&#x4E4B;&#x540E;&#xFF0C;&#x5C1D;&#x8BD5;&#x9010;&#x6761;&#x6267;&#x884C;&#x66FF;&#x6362;&#x540E;&#x7684;&#x547D;&#x4EE4;&#x3002;</li>
</ol>
<p>&#x6BD4;&#x5982;</p>
<pre><code>give @a[tag=stone] stone
</code></pre><p>&#x6E38;&#x620F;&#x4F1A;&#x5148;&#x628A;&#x547D;&#x4EE4;&#x5206;&#x4E3A;&#x4E0D;&#x540C;&#x7684;&#x53C2;&#x6570;&#xFF0C;&#x5C31;&#x662F; <code>give</code>&#x3001;<code>@a[tag=stone]</code>&#x3001;<code>stone</code>&#x3002;<br>&#x7136;&#x540E;&#x6211;&#x4EEC;&#x627E;&#x5230;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x53EF;&#x9009;&#x62E9;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x7684;&#x9009;&#x62E9;&#x5668;&#x53C2;&#x6570;&#x5C31;&#x662F;<code>@a[tag=stone]</code>&#x3002;</p>
<p>&#x5047;&#x8BBE;&#x5F53;&#x524D;&#x4E16;&#x754C;&#x6709;5&#x4E2A;&#x73A9;&#x5BB6;&#xFF0C;&#x90FD;&#x6709;<code>stone</code>&#x8FD9;tag&#xFF0C;&#x5206;&#x522B;&#x4E3A;<code>a</code>&#x3001;<code>b</code>&#x3001;<code>c</code>&#x3001;<code>d</code>&#x3001;<code>e</code>&#x3002;&#x5047;&#x8BBE;&#x79BB;&#x6267;&#x884C;&#x5750;&#x6807;&#x7684;&#x8DDD;&#x79BB;&#x662F;<code>a</code>&#x6700;&#x8FD1;&#xFF0C;<code>b</code>&#x6B21;&#x4E4B;&#xFF0C;&#x5982;&#x6B64;&#x7C7B;&#x63A8;&#x3002;</p>
<p>&#x90A3;&#x4E48;&#x90A3;&#x547D;&#x4EE4;&#x4F1A;&#x4F9D;&#x6B21;&#x88AB;&#x66FF;&#x6362;&#x4E3A;&#xFF1A;</p>
<pre><code>give a stone
give b stone
give c stone
give d stone
give e stone
</code></pre><p>&#x5E76;&#x4E14;&#x4F9D;&#x6B21;&#x88AB;&#x6267;&#x884C;&#x3002;</p>
<blockquote>
<p>&#x7531;&#x4E8E;&#x6B64;&#x539F;&#x5219;&#xFF0C;&#x4E00;&#x4E9B;&#x547D;&#x4EE4;&#x5982;<code>scoreboard players operation</code>&#x5C31;&#x6709;&#x4E00;&#x4E2A;&#x5F88;&#x5927;&#x7684;&#x9650;&#x5236;&#xFF1A;&#x4E24;&#x4E2A;&#x76EE;&#x6807;&#x4E4B;&#x95F4;&#x5FC5;&#x987B;&#x6709;&#x4E00;&#x4E2A;&#x53EA;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x76EE;&#x6807;&#xFF0C;&#x5E76;&#x4E14;&#x5FC5;&#x987B;&#x5199;&#x6E05;&#x695A;&#x662F;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x3002;<br>&#x867D;&#x7136;&#x66FF;&#x6362;&#x7684;&#x8FC7;&#x7A0B;&#x5728;<strong>&#x4E00;&#x6761;&#x4E00;&#x822C;&#x547D;&#x4EE4;</strong>&#x4E2D;&#x53EA;&#x4F1A;&#x66FF;&#x6362;&#x4E00;&#x6B21;&#xFF0C;&#x4F46;&#x5728;&#x4E00;&#x4E9B;<strong>&#x590D;&#x5408;&#x547D;&#x4EE4;</strong>&#xFF08;&#x547D;&#x4EE4;&#x5D4C;&#x5957;&#xFF09;&#x4E2D;&#x4F1A;&#x66FF;&#x6362;&#x591A;&#x6B21;&#x3002;&#x4F8B;&#x5982;<code>execute</code>&#x5D4C;&#x5957;&#xFF0C;&#x5C31;&#x5F88;&#x5BB9;&#x6613;&#x51FA;&#x73B0;&#x9700;&#x8981;&#x591A;&#x6B21;&#x9009;&#x62E9;&#x4E0D;&#x540C;&#x5B9E;&#x4F53;&#x7684;&#x60C5;&#x51B5;&#x3002;&#x6839;&#x636E;&#x8FD9;&#x4E2A;&#x66FF;&#x6362;&#x903B;&#x8F91;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x5B9E;&#x9645;&#x4E0A;&#x6267;&#x884C;&#x7684;&#x547D;&#x4EE4;&#x6570;&#x589E;&#x52A0;&#x7684;&#x5F88;&#x5FEB;&#x3002;</p>
</blockquote>
<h2 id="&#x6210;&#x529F;&#x6B21;&#x6570;&#x3001;&#x5B9E;&#x4F53;&#x6570;">&#x6210;&#x529F;&#x6B21;&#x6570;&#x3001;&#x5B9E;&#x4F53;&#x6570;</h2>
<p>&#x597D;&#x4E86;&#xFF0C;&#x5C31;&#x7B97;&#x6211;&#x4EEC;&#x77E5;&#x9053;&#x8FD9;&#x547D;&#x4EE4;&#x6267;&#x884C;&#x673A;&#x5236;&#xFF0C;&#x90A3;&#x4E48;&#x53C8;&#x5982;&#x4F55;&#x5462;&#xFF1F;<br>&#x5176;&#x5B9E;SuccessCount&#x4E0E;AffectedEntities&#x548C;<code>&#x7B2C;&#x4E00;&#x4E2A;&#x53EF;&#x9009;&#x62E9;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x7684;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;</code>&#x6709;&#x5173;&#x3002;</p>
<ul>
<li>AffectedEntities: <code>&#x7B2C;&#x4E00;&#x4E2A;&#x53EF;&#x9009;&#x62E9;&#x591A;&#x4E2A;&#x76EE;&#x6807;&#x7684;&#x76EE;&#x6807;&#x9009;&#x62E9;&#x5668;</code>&#x9009;&#x62E9;&#x5230;&#x7684;&#x5B9E;&#x4F53;&#x6570;&#x3002;&#x4E0D;&#x8BBA;&#x4E4B;&#x540E;&#x7684;&#x547D;&#x4EE4;&#x662F;&#x5426;&#x6210;&#x529F;&#x6267;&#x884C;&#x3002;&#x8FD9;&#x4E2A;&#x5728;&#x547D;&#x4EE4;<strong>&#x6267;&#x884C;&#x524D;</strong>&#x5C31;&#x4F1A;&#x88AB;&#x8BBE;&#x7F6E;&#x3002;</li>
<li>SuccessCount: &#x547D;&#x4EE4;<strong>&#x88AB;&#x66FF;&#x6362;&#x540E;&#x6210;&#x529F;&#x6267;&#x884C;&#x7684;&#x6B21;&#x6570;</strong>&#x3002;&#x4E0D;&#x591A;&#x4E8E;AffectedEntities&#x6570;&#x503C;&#x3002;&#x8FD9;&#x4E2A;&#x5728;&#x547D;&#x4EE4;<strong>&#x6267;&#x884C;&#x540E;</strong>&#x624D;&#x4F1A;&#x88AB;&#x8BBE;&#x7F6E;&#x3002;</li>
</ul>
<p>&#x6545;&#x6B64;&#x6211;&#x4EEC;&#x5982;&#x679C;&#x8981;&#x77E5;&#x9053;<strong>&#x771F;&#x6B63;&#x88AB;&#x5F71;&#x54CD;</strong>&#x7684;&#x5B9E;&#x4F53;&#x6570;&#xFF0C;&#x6216;&#x8BB8;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4F7F;&#x7528;SuccessCount&#x3002;</p>
<h2 id="&#x4F8B;&#x5916;&#x60C5;&#x51B5;">&#x4F8B;&#x5916;&#x60C5;&#x51B5;</h2>
<p><code>spreadplayers</code>&#x53CA;<code>scoreboard teams join</code>&#x547D;&#x4EE4;&#x90FD;&#x662F;&#x4F8B;&#x5916;&#x60C5;&#x51B5;&#xFF0C;&#x5176;SuccessCount&#x6700;&#x5927;&#x4E3A;1&#xFF0C;&#x5176;AffectedEntities&#x624D;&#x662F;&#x53D7;&#x5F71;&#x54CD;&#x7684;&#x5B9E;&#x4F53;&#x6570;&#x3002;<br>&#x56E0;&#x4E3A;&#x6B64;&#x547D;&#x4EE4;&#x4E0D;&#x5B9A;&#x4E49;&#x6240;&#x8C13;&#x7684;&#x9009;&#x62E9;&#x5668;&#x53C2;&#x6570;&#xFF0C;&#x56E0;&#x6B64;&#x6E38;&#x620F;&#x4E0D;&#x4F1A;&#x5BF9;&#x9009;&#x62E9;&#x5668;&#x8FDB;&#x884C;&#x66FF;&#x6362;&#x3002;&#xFF08;&#x56E0;&#x4E3A;&#x6B64;&#x547D;&#x4EE4;&#x6709;&#x7279;&#x522B;&#x5904;&#x7406;&#x9009;&#x62E9;&#x5668;&#x7684;&#x65B9;&#x5F0F;&#xFF09;</p>
<h2 id="&#x53C2;&#x89C1;">&#x53C2;&#x89C1;</h2>
<p>&#x4F1A;Java&#x7684;&#x670B;&#x53CB;&#x5982;&#x679C;&#x60F3;&#x770B;&#x6E90;&#x7801;&#xFF0C;&#x8BF7;&#x770B;mcp&#x7684;</p>
<ul>
<li><code>net.minecraft.command.CommandBase</code>&#x91CC;&#xFF0C;&#x6709;&#x4E00;&#x4E2A;<code>isUsernameIndex</code>&#x7684;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x4F1A;&#x544A;&#x8BC9;<code>CommandHandler</code>&#x54EA;&#x513F;&#x662F;&#x5B9E;&#x4F53;&#x76EE;&#x6807;&#x3002;</li>
<li><code>net.minecraft.command.CommandHandler</code>&#x3002;&#x8FD9;&#x662F;&#x4E0A;&#x9762;&#x8BF4;&#x7684;&#x547D;&#x4EE4;&#x6267;&#x884C;&#x903B;&#x8F91;&#x90E8;&#x5206;&#x3002;</li>
<li><code>net.minecraft.command.EntitySelector</code>&#x3002;&#x8FD9;&#x91CC;&#x7684;<code>matchesMultiplePlayers</code>&#x5B9A;&#x4E49;&#x4E86;&#x600E;&#x6837;&#x7684;&#x9009;&#x62E9;&#x5668;&#x624D;&#x7B97;&#x662F;&#x53EA;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x76EE;&#x6807;&#x3002;</li>
</ul>
<p>stats&#x7684;&#x4F8B;&#x5B50;:</p>
<ul>
<li><a href="../scoreboard/command.html#stats&#x547D;&#x4EE4;">&#x8BB0;&#x5206;&#x677F;&#x4F8B;&#x5B50;&#x2014;&#x2014;Stats&#x57FA;&#x7840;&#x8FD0;&#x7528;</a></li>
<li><a href="../logic/execute.html">execute&#x4F8B;&#x5B50;&#x2014;&#x2014;&#x6210;&#x529F;&#x6B21;&#x6570;&#x7684;&#x9AD8;&#x7EA7;&#x8FD0;&#x7528;</a></li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="selector/selector.html" class="navigation navigation-prev " aria-label="Previous page: 1.4 目标选择器">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../common-format/common-format.html" class="navigation navigation-next " aria-label="Next page: 2 常用命令格式">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1.5 命令执行统计","level":"1.2.5","depth":2,"next":{"title":"2 常用命令格式","level":"1.3","depth":1,"path":"common-format/common-format.md","ref":"common-format/common-format.md","articles":[{"title":"2.1 JSON文本","level":"1.3.1","depth":2,"path":"common-format/json/json.md","ref":"common-format/json/json.md","articles":[{"title":"2.1.1 JSON文本类型","level":"1.3.1.1","depth":3,"path":"common-format/json/type.md","ref":"common-format/json/type.md","articles":[]},{"title":"2.1.2 JSON样式","level":"1.3.1.2","depth":3,"path":"common-format/json/formatting.md","ref":"common-format/json/formatting.md","articles":[]},{"title":"2.1.3 JSON事件","level":"1.3.1.3","depth":3,"path":"common-format/json/event.md","ref":"common-format/json/event.md","articles":[]},{"title":"2.1.4 JSON分项","level":"1.3.1.4","depth":3,"path":"common-format/json/array.md","ref":"common-format/json/array.md","articles":[]},{"title":"2.1.5 告示牌及成书","level":"1.3.1.5","depth":3,"path":"common-format/json/sign-book.md","ref":"common-format/json/sign-book.md","articles":[]},{"title":"2.1.6 杂项","level":"1.3.1.6","depth":3,"path":"common-format/json/other.md","ref":"common-format/json/other.md","articles":[]},{"title":"2.1.A 附录: keybind列表","level":"1.3.1.7","depth":3,"path":"common-format/json/keys.md","ref":"common-format/json/keys.md","articles":[]}]},{"title":"2.2 NBT及结构","level":"1.3.2","depth":2,"path":"common-format/nbt/nbt.md","ref":"common-format/nbt/nbt.md","articles":[{"title":"2.2.1 基本类型","level":"1.3.2.1","depth":3,"path":"common-format/nbt/simple.md","ref":"common-format/nbt/simple.md","articles":[]},{"title":"2.2.2 NBT实战","level":"1.3.2.2","depth":3,"path":"common-format/nbt/example.md","ref":"common-format/nbt/example.md","articles":[]}]}]},"previous":{"title":"1.4 目标选择器","level":"1.2.4","depth":2,"path":"concepts/selector/selector.md","ref":"concepts/selector/selector.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","lb2br","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"lb2br":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"命令进阶","language":"en","gitbook":"*","description":"一份Minecraft命令教程"},"file":{"path":"concepts/stats.md","mtime":"2017-07-29T08:17:16.829Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-08T10:37:55.949Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

